/**
 * Copyright 2008 Benjamin Possolo
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.javenue.util.process;

/**
 * Represents the progress status of an executing process.
 * <p>
 * A process can optionally set its 
 * <code>progressState</code> member variable during the execution of its <code>run()</code> method
 * as a way to offer external components a means for determining the progress of the process.
 * Concrete implementations of the <tt>Process</tt> class notify registered
 * <tt>PropertyChangeListener</tt>s whenever the <code>progressStatus</code> changes.
 * <p>
 * This class simply encapsulates a numeric value that represents the progress (generally on a scale
 * from 0 - 100) and a descriptive message.
 * 
 * @see Process
 * @author Benjamin Possolo
 * <p>Created on Aug 27, 2007
 */
public class ProgressStatus {
	
	/**
	 * A numeric value that represents the progress of a process. Generally, this number
	 * will range between 0 and 100.
	 */
	final int progress;
	
	/**
	 * A descriptive message that represents the progress value.
	 */
	final String message;
	
	/**
	 * Basic constructor that sets the progress value and message.
	 * 
	 * @param progress the progress value to set. Generally this will be a number between 0 and 100.
	 * @param message a descriptive message that represents the progress
	 */
	public ProgressStatus(int progress, String message){
		this.progress = progress;
		this.message = message;
	}

	/**
	 * Gets the descriptive message.
	 * 
	 * @return the message
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * Gets the progress value.
	 * 
	 * @return the progress
	 */
	public int getProgress() {
		return progress;
	}
}
